// 获取用户信息
index()
function index() {
    let token = localStorage.getItem('token')
    $.ajax({
        type: "get",
        url: "http://120.48.109.174:8081/user",
        headers: {
            'authorization': token
        },
        success: function (res) {
            let data = res.body
            let module = `
            <p>名字：${data.nickname}</p>
            <p>${data.gender == 1 ? '女' : '男'}</p>
            <p>id：${data.id}</p>
            <p><img src="http://120.48.109.174:8081${data.avatar}" alt=""></p>
            `
            $('.cont').append(module)
        }
    });
}

// 更新用户信息
$('.spn').on('click', function () {
    location.href = '../3.15login.sign/information.html'
})

// 返回登录界面
$('.spn1').on('click', function () {
    location.href = '../3.15login.sign/login.html'
})